home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / r / rexx_plus_compiler / rexxpluscompiler2.dms / in.adf / RexxPlPlot / Examples / examples.zoo / Example04.plot < prev    next >
Encoding:
Text File  |  1990-03-17  |  1.0 KB  |  38 lines

  1. /* Example04.plot - Illustration of logarithmic axes, and redefinition
  2.  *                - of window
  3.  * Modified for RexxPlPlot by Glenn M. Lewis - 9/12/89
  4.  */
  5.  
  6. address 'PlPlot'
  7. say 'Please be patient...'
  8.  
  9.       'plstar(1,1);'
  10.       'pladv(0);'
  11.       'plfont(2);'
  12.  
  13.       f0 = 1000.0;
  14.       do i=1 to 101
  15.         freql.i = i/20.0;
  16.         freq    = pow(10.0,freql.i);
  17.         ampl.i  = 20.0*log10(1.0/sqrt(1.0+pow((freq/f0),2.0)));
  18.         phase.i = -(180.0/3.141592654)*atan(freq/f0);
  19.       end i
  20.  
  21.       'plvpor(0.15,0.85,0.1,0.9);'
  22.       'plwind(1.0,6.0,-80.0,0.0);'
  23.       'plbox("bclnst",0.0,0,"bnstv",0.0,0);'
  24.       'plline(101,freql,ampl);'
  25.       'plptex(5.0,-30.0,1.0,-20.0,0.5,"-20 dB/decade");'
  26.       'plwind(1.0,6.0,-100.0,0.0);'
  27.       'plbox(" ",0.0,0,"cmstv",30.0,3);'
  28.       'plline(101,freql,phase);'
  29.  
  30.       'plmtex("b",3.2,0.5,0.5,"Frequency");'
  31.       'plmtex("t",2.0,0.5,0.5,"Single Pole Low-Pass Filter");'
  32.       'plmtex("l",5.0,0.5,0.5,"Amplitude (dB)");'
  33.       'plmtex("r",5.0,0.5,0.5,"Phase shift (degrees)");'
  34.  
  35.       'plend();'
  36.  
  37. exit 0
  38.